import axiosRequest from "@/api/axiosRequest.ts";

const BaseUrl = '/admin/user'

const getUserDetail = (id:number) => axiosRequest({
  url:BaseUrl + '/detail' ,
  method: 'GET',
  params: {
    id: id
  }
})

const getUserPage  = (page:number=1, pageSize?:number) => axiosRequest({
  url:BaseUrl + '/page' ,
  method: 'GET',
  params:  {
    page: page,
    pageSize: pageSize
  }
})

const deleteUser = (id:number) => axiosRequest({
  url:BaseUrl + '/delete' ,
  method: 'DELETE',
  params: {
    id: id
  }
})

export const userApi = {
  getUserInfo : () => axiosRequest.get(BaseUrl + '/info'),
  getUserDetail,
  getUserPage,
  deleteUser
}
